<% if question.new_record? %>
  <%= set_alias "form_qed_#{question.id}", "form_qnql_#{question.question_list_id}" %>
<% end %>

<%= form_for question, remote: true, html: { id: "form_qed_#{question.id}" } do |f| %>

  <%= f.hidden_field :question_list_id %>
  <%= really_submit_tag %>

  <div class="question-list-item">
    <div class="question-list-item-title">
      <div class="left">
        <h4>
            <%= question.new_record? ?
              '添加题目' :
              question.current_version.question_type.name %>
        </h4>
      </div>
    </div>
    <div class="question-list-item-content">
      <%= render partial: 'question_versions/form',
          locals: { question_version: question.current_version } %>
    </div>
    <div class="question-list-item-meta">
      <div class="right">
        <ul class="inline-list">
          <li>
            <%= f.submit '提交', 'class' => 'button primary', onclick: 
                create_js_true({"set('really_submit','true')" => "form_qed_#{question.id}"}) %>
          </li>
          <% if !question.new_record? %>
          <li>
            <%= button_tag '取消', type: 'button', 'class' => 'button', onClick: 
              create_js({ hide: "form_qed_#{question.id}", show: "div_qshql_#{question.id}"})  %>
          </li>
          <% end %>
        </ul>
      </div>
      <div class="clear"></div>
    </div>
  </div>

<% end %>
